
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">

    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
<h:form id="form">
    <p:growl id="messages" showDetail="true"/>

    <p:panel header="Players">
        <h:panelGrid columns="2" cellpadding="5">
            <h:outputLabel value="Basic Pojo: " for="basicPojo"/>
            <p:autoComplete value="#{autoCompleteBean.selectedPlayer1}" id="basicPojo" completeMethod="#{autoCompleteBean.completePlayer}"
                        var="p" itemLabel="#{p.name}" itemValue="#{p}" converter="professor" forceSelection="true"/>
                </h:panelGrid>
    </p:panel>

    <br/>

    <p:commandButton value="Submit" update="display" oncomplete="dlg.show()"/>

    <p:dialog header="Selected Players" widgetVar="dlg" showEffect="fade" hideEffect="fade" modal="true">
        <h:panelGrid columns="1" id="display">
            <h:outputText id="txt1" value="Player 1: #{autoCompleteBean.selectedPlayer1.name}" rendered="#{not empty autoCompleteBean.selectedPlayer1}"/>
            
        </h:panelGrid>
    </p:dialog>
</h:form>  

    </h:body>
</html>

